<?php
class Ddup_Tags_Block_Popular extends Mage_Tag_Block_Popular
{
	/**
     * Cache Block
     * @author	Aaron
     * @see Mage_Core_Block_Template::_construct()
     */
	protected function _construct()
    {
    	parent::_construct();
    	$categoryId = Mage::getResourceModel('tag/popular_collection')->getCurrentCategory()->getId();
    	$_customer = Mage::getSingleton('customer/session')->getCustomer();
        $this->addData(array(
            'cache_lifetime'=> 2592000,
            'cache_tags'    => array(Mage_Core_Model_Store::CACHE_TAG),
        	'cache_key'		=> 'CACHE_TAG_' .
        				Mage::App()->getStore()->getCode().'_' .
        				'CATEGORY_' . $categoryId . '_' .
        				'CUSTOMER_' . $_customer->getGroupId()
        ));
    }
}
